home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6434 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.3 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 62 6c | 61 63 6b 2e 77 65 65 67 |Path: bl|ack.weeg|
|00000010| 2e 75 69 6f 77 61 2e 65 | 64 75 21 72 6f 62 69 6e |.uiowa.e|du!robin|
|00000020| 73 6f 6e 0a 46 72 6f 6d | 3a 20 54 68 65 20 41 6d |son.From|: The Am|
|00000030| 6f 72 70 68 6f 75 73 20 | 4d 61 73 73 20 3c 72 6f |orphous |Mass <ro|
|00000040| 62 69 6e 73 6f 6e 40 62 | 6c 75 65 2e 77 65 65 67 |binson@b|lue.weeg|
|00000050| 2e 75 69 6f 77 61 2e 65 | 64 75 3e 0a 4e 65 77 73 |.uiowa.e|du>.News|
|00000060| 67 72 6f 75 70 73 3a 20 | 63 6f 6d 70 2e 6c 61 6e |groups: |comp.lan|
|00000070| 67 2e 63 0a 53 75 62 6a | 65 63 74 3a 20 52 65 3a |g.c.Subj|ect: Re:|
|00000080| 20 5b 51 5d 20 44 6f 65 | 73 20 66 72 65 65 28 29 | [Q] Doe|s free()|
|00000090| 20 77 6f 72 6b 3f 0a 44 | 61 74 65 3a 20 53 61 74 | work?.D|ate: Sat|
|000000a0| 2c 20 32 34 20 46 65 62 | 20 31 39 39 36 20 31 35 |, 24 Feb| 1996 15|
|000000b0| 3a 30 36 3a 32 37 20 2d | 30 36 30 30 0a 4f 72 67 |:06:27 -|0600.Org|
|000000c0| 61 6e 69 7a 61 74 69 6f | 6e 3a 20 55 6e 69 76 65 |anizatio|n: Unive|
|000000d0| 72 73 69 74 79 20 6f 66 | 20 49 6f 77 61 2c 20 49 |rsity of| Iowa, I|
|000000e0| 6f 77 61 20 43 69 74 79 | 2c 20 49 41 2c 20 55 53 |owa City|, IA, US|
|000000f0| 41 0a 44 69 73 74 72 69 | 62 75 74 69 6f 6e 3a 20 |A.Distri|bution: |
|00000100| 77 6f 72 6c 64 0a 4d 65 | 73 73 61 67 65 2d 49 44 |world.Me|ssage-ID|
|00000110| 3a 20 3c 50 69 6e 65 2e | 41 33 32 2e 33 2e 39 31 |: <Pine.|A32.3.91|
|00000120| 2e 39 36 30 32 32 34 31 | 34 35 38 34 34 2e 33 39 |.9602241|45844.39|
|00000130| 38 30 32 43 2d 31 30 30 | 30 30 30 40 62 6c 61 63 |802C-100|000@blac|
|00000140| 6b 2e 77 65 65 67 2e 75 | 69 6f 77 61 2e 65 64 75 |k.weeg.u|iowa.edu|
|00000150| 3e 0a 52 65 66 65 72 65 | 6e 63 65 73 3a 20 3c 34 |>.Refere|nces: <4|
|00000160| 67 6d 33 73 73 24 71 66 | 61 40 6e 65 77 73 2e 69 |gm3ss$qf|a@news.i|
|00000170| 6e 66 6f 73 65 72 76 65 | 2e 6e 65 74 3e 20 3c 50 |nfoserve|.net> <P|
|00000180| 69 6e 65 2e 41 33 32 2e | 33 2e 39 31 2e 39 36 30 |ine.A32.|3.91.960|
|00000190| 32 32 33 32 33 33 35 32 | 36 2e 31 31 33 34 38 32 |22323352|6.113482|
|000001a0| 44 2d 31 30 30 30 30 30 | 40 62 6c 61 63 6b 2e 77 |D-100000|@black.w|
|000001b0| 65 65 67 2e 75 69 6f 77 | 61 2e 65 64 75 3e 20 3c |eeg.uiow|a.edu> <|
|000001c0| 33 31 32 46 37 33 37 32 | 2e 32 32 35 37 40 69 61 |312F7372|.2257@ia|
|000001d0| 64 66 77 2e 6e 65 74 3e | 0a 4e 4e 54 50 2d 50 6f |dfw.net>|.NNTP-Po|
|000001e0| 73 74 69 6e 67 2d 48 6f | 73 74 3a 20 62 6c 61 63 |sting-Ho|st: blac|
|000001f0| 6b 2e 77 65 65 67 2e 75 | 69 6f 77 61 2e 65 64 75 |k.weeg.u|iowa.edu|
|00000200| 0a 4d 69 6d 65 2d 56 65 | 72 73 69 6f 6e 3a 20 31 |.Mime-Ve|rsion: 1|
|00000210| 2e 30 0a 43 6f 6e 74 65 | 6e 74 2d 54 79 70 65 3a |.0.Conte|nt-Type:|
|00000220| 20 54 45 58 54 2f 50 4c | 41 49 4e 3b 20 63 68 61 | TEXT/PL|AIN; cha|
|00000230| 72 73 65 74 3d 55 53 2d | 41 53 43 49 49 0a 58 2d |rset=US-|ASCII.X-|
|00000240| 53 65 6e 64 65 72 3a 20 | 72 6f 62 69 6e 73 6f 6e |Sender: |robinson|
|00000250| 40 62 6c 61 63 6b 2e 77 | 65 65 67 2e 75 69 6f 77 |@black.w|eeg.uiow|
|00000260| 61 2e 65 64 75 0a 49 6e | 2d 52 65 70 6c 79 2d 54 |a.edu.In|-Reply-T|
|00000270| 6f 3a 20 3c 33 31 32 46 | 37 33 37 32 2e 32 32 35 |o: <312F|7372.225|
|00000280| 37 40 69 61 64 66 77 2e | 6e 65 74 3e 20 0a 0a 4f |7@iadfw.|net> ..O|
|00000290| 6e 20 53 61 74 2c 20 32 | 34 20 46 65 62 20 31 39 |n Sat, 2|4 Feb 19|
|000002a0| 39 36 2c 20 4c 61 72 72 | 79 20 57 65 69 73 73 20 |96, Larr|y Weiss |
|000002b0| 77 72 6f 74 65 3a 0a 0a | 3e 20 54 68 65 20 41 6d |wrote:..|> The Am|
|000002c0| 6f 72 70 68 6f 75 73 20 | 4d 61 73 73 20 77 72 6f |orphous |Mass wro|
|000002d0| 74 65 3a 0a 3e 20 20 3e | 20 0a 3e 20 20 3e 20 20 |te:.> >| .> > |
|000002e0| 20 2e 2e 2e 20 6d 65 6d | 6f 72 79 20 61 6c 6c 6f | ... mem|ory allo|
|000002f0| 63 61 74 69 6f 6e 20 69 | 73 20 6f 6e 65 20 6f 66 |cation i|s one of|
|00000300| 20 74 68 65 20 73 6c 6f | 77 65 73 74 20 74 68 69 | the slo|west thi|
|00000310| 6e 67 73 20 61 20 43 0a | 3e 20 20 3e 20 70 72 6f |ngs a C.|> > pro|
|00000320| 67 72 61 6d 20 63 61 6e | 20 64 6f 20 61 6e 64 20 |gram can| do and |
|00000330| 69 66 20 74 68 65 20 6d | 61 6c 6c 6f 63 28 29 20 |if the m|alloc() |
|00000340| 70 61 63 6b 61 67 65 20 | 64 6f 65 73 6e 27 74 20 |package |doesn't |
|00000350| 68 61 76 65 20 74 6f 20 | 61 63 74 75 61 6c 6c 79 |have to |actually|
|00000360| 0a 3e 20 20 3e 20 72 65 | 71 75 65 73 74 20 6d 65 |.> > re|quest me|
|00000370| 6d 6f 72 79 20 66 72 6f | 6d 20 61 6e 64 20 72 65 |mory fro|m and re|
|00000380| 6c 65 61 73 65 20 69 74 | 20 74 6f 20 74 68 65 20 |lease it| to the |
|00000390| 4f 53 20 74 68 65 6e 20 | 69 74 20 63 61 6e 20 72 |OS then |it can r|
|000003a0| 75 6e 20 66 61 73 74 65 | 72 2c 0a 3e 20 20 3e 20 |un faste|r,.> > |
|000003b0| 63 61 75 73 65 20 6c 65 | 73 73 20 66 72 61 67 6d |cause le|ss fragm|
|000003c0| 65 6e 74 61 74 69 6f 6e | 2c 20 61 6c 6c 6f 77 20 |entation|, allow |
|000003d0| 47 43 2c 20 65 74 63 2e | 20 20 4f 66 20 63 6f 75 |GC, etc.| Of cou|
|000003e0| 72 73 65 20 6e 6f 6e 65 | 20 6f 66 20 74 68 65 73 |rse none| of thes|
|000003f0| 65 0a 3e 20 20 3e 20 62 | 65 6e 65 66 69 74 73 20 |e.> > b|enefits |
|00000400| 61 72 65 20 67 75 61 72 | 61 6e 74 65 65 64 2e 20 |are guar|anteed. |
|00000410| 3a 29 0a 3e 20 20 3e 20 | 0a 3e 20 0a 3e 20 49 20 |:).> > |.> .> I |
|00000420| 64 69 73 61 67 72 65 65 | 2e 20 20 49 20 75 73 65 |disagree|. I use|
|00000430| 64 20 74 6f 20 62 65 6c | 69 65 76 65 20 74 68 69 |d to bel|ieve thi|
|00000440| 73 20 61 6c 73 6f 2c 20 | 61 6e 64 20 77 6f 75 6c |s also, |and woul|
|00000450| 64 20 61 76 6f 69 64 20 | 73 6f 70 68 69 73 74 69 |d avoid |sophisti|
|00000460| 63 61 74 65 64 20 0a 3e | 20 6d 65 74 68 6f 64 73 |cated .>| methods|
|00000470| 20 69 6e 76 6f 6c 76 69 | 6e 67 20 6c 69 6e 6b 65 | involvi|ng linke|
|00000480| 64 20 6c 69 73 74 73 20 | 61 6e 64 20 73 75 63 68 |d lists |and such|
|00000490| 2c 20 62 75 74 20 6e 6f | 77 20 68 61 76 65 20 63 |, but no|w have c|
|000004a0| 6f 6d 65 20 74 6f 20 72 | 65 61 6c 69 7a 65 20 74 |ome to r|ealize t|
|000004b0| 68 61 74 0a 3e 20 74 68 | 65 73 65 20 61 6c 6c 6f |hat.> th|ese allo|
|000004c0| 63 61 74 69 6f 6e 73 20 | 61 72 65 20 22 63 68 65 |cations |are "che|
|000004d0| 61 70 22 20 77 69 74 68 | 20 6d 6f 64 65 72 6e 20 |ap" with| modern |
|000004e0| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 73 20 |implemen|tations |
|000004f0| 61 6e 64 20 73 68 6f 75 | 6c 64 20 62 65 20 75 73 |and shou|ld be us|
|00000500| 65 64 0a 3e 20 77 68 65 | 6e 65 76 65 72 20 74 68 |ed.> whe|never th|
|00000510| 65 79 20 61 70 70 6c 79 | 2e 0a 0a 20 20 57 6f 75 |ey apply|... Wou|
|00000520| 6c 64 20 79 6f 75 20 61 | 67 72 65 65 20 74 68 65 |ld you a|gree the|
|00000530| 6e 20 74 68 61 74 20 61 | 6c 6c 6f 77 69 6e 67 20 |n that a|llowing |
|00000540| 6d 61 6c 6c 6f 63 28 29 | 20 74 6f 20 62 65 20 61 |malloc()| to be a|
|00000550| 62 73 74 72 61 63 74 65 | 64 20 66 72 6f 6d 20 0a |bstracte|d from .|
|00000560| 61 63 74 75 61 6c 20 6d | 65 6d 6f 72 79 20 61 6c |actual m|emory al|
|00000570| 6c 6f 63 61 74 69 6f 6e | 20 6d 61 6b 65 73 20 69 |location| makes i|
|00000580| 74 20 66 61 73 74 65 72 | 20 6f 6e 20 74 68 6f 73 |t faster| on thos|
|00000590| 65 20 70 6c 61 74 66 6f | 72 6d 73 20 28 6c 69 6b |e platfo|rms (lik|
|000005a0| 65 20 6d 79 20 0a 61 6e | 74 69 71 75 61 74 65 64 |e my .an|tiquated|
|000005b0| 20 4d 61 63 29 20 77 68 | 65 72 65 20 6f 6e 2d 64 | Mac) wh|ere on-d|
|000005c0| 65 6d 61 6e 64 20 6d 65 | 6d 6f 72 79 20 61 6c 6c |emand me|mory all|
|000005d0| 6f 63 61 74 69 6f 6e 20 | 69 73 20 73 6c 6f 77 20 |ocation |is slow |
|000005e0| 28 6f 72 20 66 6f 72 20 | 6f 74 68 65 72 20 0a 72 |(or for |other .r|
|000005f0| 65 61 73 6f 6e 73 29 2c | 20 77 68 69 6c 65 20 61 |easons),| while a|
|00000600| 6c 6c 6f 77 69 6e 67 20 | 69 74 20 74 6f 20 75 73 |llowing |it to us|
|00000610| 65 20 6f 6e 2d 64 65 6d | 61 6e 64 20 6d 65 6d 6f |e on-dem|and memo|
|00000620| 72 79 20 61 6c 6c 6f 63 | 61 74 69 6f 6e 20 77 68 |ry alloc|ation wh|
|00000630| 65 6e 20 0a 74 68 61 74 | 27 73 20 6d 6f 72 65 20 |en .that|'s more |
|00000640| 61 70 70 72 6f 70 72 69 | 61 74 65 20 77 69 74 68 |appropri|ate with|
|00000650| 6f 75 74 20 63 68 61 6e | 67 69 6e 67 20 74 68 65 |out chan|ging the|
|00000660| 20 73 65 6d 61 6e 74 69 | 63 73 3f 20 20 57 68 61 | semanti|cs? Wha|
|00000670| 74 27 73 20 69 6d 70 6f | 72 74 61 6e 74 20 0a 69 |t's impo|rtant .i|
|00000680| 73 20 6e 6f 74 20 74 68 | 61 74 20 74 68 65 73 65 |s not th|at these|
|00000690| 20 74 68 69 6e 67 73 20 | 61 72 65 20 61 6c 77 61 | things |are alwa|
|000006a0| 79 73 20 74 72 75 65 20 | 69 6e 20 75 70 2d 74 6f |ys true |in up-to|
|000006b0| 2d 74 68 65 2d 6d 69 6e | 75 74 65 20 68 61 72 64 |-the-min|ute hard|
|000006c0| 77 61 72 65 2c 20 62 75 | 74 20 0a 74 68 61 74 20 |ware, bu|t .that |
|000006d0| 74 68 65 79 20 61 72 65 | 20 74 68 65 20 72 61 74 |they are| the rat|
|000006e0| 69 6f 6e 61 6c 65 20 62 | 65 68 69 6e 64 20 6d 61 |ionale b|ehind ma|
|000006f0| 6c 6c 6f 63 28 29 27 73 | 20 63 75 72 72 65 6e 74 |lloc()'s| current|
|00000700| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 2e | impleme|ntation.|
|00000710| 0a 0a 20 20 51 75 65 73 | 74 69 6f 6e 3a 20 20 49 |.. Ques|tion: I|
|00000720| 27 6d 20 74 68 69 6e 6b | 69 6e 67 20 6f 66 20 77 |'m think|ing of w|
|00000730| 72 69 74 69 6e 67 20 61 | 20 6d 6f 64 65 73 74 20 |riting a| modest |
|00000740| 43 20 63 6f 6d 70 69 6c | 65 72 20 66 6f 72 20 74 |C compil|er for t|
|00000750| 68 65 20 4d 61 63 2c 20 | 0a 77 68 69 63 68 20 70 |he Mac, |.which p|
|00000760| 72 65 66 65 72 73 20 74 | 68 61 74 20 6d 65 6d 6f |refers t|hat memo|
|00000770| 72 79 20 62 65 20 61 6c | 6c 6f 63 61 74 65 64 20 |ry be al|located |
|00000780| 61 6e 64 20 72 65 66 65 | 72 72 65 64 20 74 6f 20 |and refe|rred to |
|00000790| 74 68 72 6f 75 67 68 20 | 68 61 6e 64 6c 65 73 20 |through |handles |
|000007a0| 0a 28 61 74 20 6c 65 61 | 73 74 20 74 68 65 20 36 |.(at lea|st the 6|
|000007b0| 38 4b 20 4d 61 63 73 20 | 64 6f 29 2e 20 20 57 6f |8K Macs |do). Wo|
|000007c0| 75 6c 64 20 69 74 20 62 | 65 20 63 6f 6e 66 6f 72 |uld it b|e confor|
|000007d0| 6d 69 6e 67 20 74 6f 20 | 68 61 76 65 20 0a 6d 61 |ming to |have .ma|
|000007e0| 6c 6c 6f 63 28 29 2f 66 | 72 65 65 28 29 20 61 6c |lloc()/f|ree() al|
|000007f0| 6c 6f 63 61 74 65 20 74 | 68 72 6f 75 67 68 20 68 |locate t|hrough h|
|00000800| 61 6e 64 6c 65 73 2c 20 | 61 6e 64 20 74 68 65 6e |andles, |and then|
|00000810| 20 74 72 61 6e 73 70 61 | 72 65 6e 74 6c 79 20 61 | transpa|rently a|
|00000820| 64 64 20 6f 6e 65 20 0a | 61 64 64 69 74 69 6f 6e |dd one .|addition|
|00000830| 61 6c 20 6c 61 79 65 72 | 20 6f 66 20 69 6e 64 69 |al layer| of indi|
|00000840| 72 65 63 74 69 6f 6e 20 | 73 6f 20 74 68 61 74 20 |rection |so that |
|00000850| 74 68 65 20 70 72 6f 67 | 72 61 6d 6d 65 72 20 63 |the prog|rammer c|
|00000860| 6f 75 6c 64 20 73 74 69 | 6c 6c 20 74 68 69 6e 6b |ould sti|ll think|
|00000870| 20 0a 69 6e 20 74 65 72 | 6d 73 20 6f 66 20 70 6f | .in ter|ms of po|
|00000880| 69 6e 74 65 72 73 3f 20 | 20 54 68 65 20 63 6f 6d |inters? | The com|
|00000890| 70 69 6c 65 72 20 49 20 | 68 61 76 65 20 6e 6f 77 |piler I |have now|
|000008a0| 20 6c 69 74 65 72 61 6c | 6c 79 20 75 73 65 73 20 | literal|ly uses |
|000008b0| 70 6f 69 6e 74 65 72 73 | 2c 20 0a 77 68 69 63 68 |pointers|, .which|
|000008c0| 20 63 61 75 73 65 73 20 | 66 72 61 67 6d 65 6e 74 | causes |fragment|
|000008d0| 61 74 69 6f 6e 2e 0a 20 | 20 49 20 73 75 70 70 6f |ation.. | I suppo|
|000008e0| 73 65 20 74 68 69 73 20 | 69 73 20 6d 6f 72 65 20 |se this |is more |
|000008f0| 63 6f 6d 70 2e 73 74 64 | 2e 63 2c 20 62 75 74 20 |comp.std|.c, but |
|00000900| 49 27 6d 20 61 6c 6d 6f | 73 74 20 61 66 72 61 69 |I'm almo|st afrai|
|00000910| 64 20 74 6f 20 70 6f 73 | 74 20 74 68 65 72 65 2e |d to pos|t there.|
|00000920| 20 3a 29 0a 0a 2d 2d 20 | 4a 61 6d 65 73 0a 65 6d | :)..-- |James.em|
|00000930| 61 69 6c 3a 20 6a 61 6d | 65 73 2d 72 6f 62 69 6e |ail: jam|es-robin|
|00000940| 73 6f 6e 40 75 69 6f 77 | 61 2e 65 64 75 0a |son@uiow|a.edu. |
+--------+-------------------------+-------------------------+--------+--------+